package com.qcby.demo.proxyaop.chain;

import com.qcby.demo.proxyaop.interceptor.Interceptor;
import lombok.extern.slf4j.Slf4j;

import java.lang.reflect.Method;

/**
 * @className: AgentInterceptor
 * @description:
 * @author: lxt
 * @create: 2021-05-12 16:35
 **/
@Slf4j
public class AgentInterceptor implements Interceptor {

    @Override
    public boolean preHandle(Object proxy, Object target, Method method, Object[] args) {
        log.info("【经纪人preHandle方法】经纪人正在与您谈判前期工作");
        return true;
    }

    @Override
    public void postHandle(Object proxy, Object target, Method method, Object[] args) {
        log.info("【经纪人postHandle方法】");
    }

    @Override
    public void afterCompletion(Object proxy, Object target, Method method, Object[] args) {
        log.info("【经纪人afterCompletion方法】无论经纪人preHandle方法返回true或false，本方法都会被调用");
    }
}
